//
//  SearchWorkerViewController.m
//  Btpin
//
//  Created by Vic on 2019/3/30.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "SearchWorkerViewController.h"
#import "CQTopBarViewController.h"
#import "LYRecomedController.h"
//#import "LYAreaController.h"
#import "PSAreaController.h"
#import "LYCompanyController.h"
#import "LYClaimController.h"
#import "LYRecomendCell.h"
#import "WorkerCell.h"
#import "WorkerResumeDetailViewController.h"
#import "CompanyJobModel.h"
#import "SelectJobViewController.h"

@interface SearchWorkerViewController ()<UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource, CQTopBarViewControllerDelegate>
{
    NSMutableArray *itemDataArray;
    
    NSMutableArray *recomendDataArray;
    NSMutableArray *areaDataArray;
    NSMutableArray *companyDataArray;
    NSMutableArray *claimDataArray;
    
    UITextField *searchTextField;
    NSInteger currentPage;
    
    NSString *recommend;
    NSString *district;
    NSString *experience;
//    NSString *minwage;
//    NSString *maxwage;
    NSString *keyword;
    NSString *lat;
    NSString *lng;
    NSString *wage;
    NSString *education;
    NSString *nature;
    
    UILabel *jobLbl;
    NSString *job_id;
    NSString *job_title;
}
@property (nonatomic, strong) CQTopBarViewController *topBar;
@property (nonatomic, strong) UITableView *jobCompanyTableView;
@end

@implementation SearchWorkerViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [UIToolsControl resignFirstResponderForTextField:searchTextField];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    itemDataArray = [NSMutableArray arrayWithCapacity:0];
    currentPage = 1;
    recommend = @"";
    district = @"";
    experience = @"";
//    minwage = @"";
//    maxwage = @"";
    keyword = @"";
    lat = @"116";
    lng = @"37.5";
    wage = @"";
    education = @"";
    nature = @"";
    job_id = @"";
    job_title = @"";
    
    [self loadDataForJobList];
    [self loadLocalData];
    [self initUI];
    [self getCompanyList];
}
- (void)getCompanyList {
    self.noDataView.hidden = YES;
    SVPHUDShow;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:recommend forKey:@"recommend"];
    [dic setObject:district forKey:@"district"];
    [dic setObject:experience forKey:@"experience"];
//    [dic setObject:minwage forKey:@"minwage"];
//    [dic setObject:maxwage forKey:@"maxwage"];
    [dic setObject:wage forKey:@"wage"];
    [dic setObject:keyword forKey:@"keyword"];
    [dic setObject:lat forKey:@"lat"];
    [dic setObject:lng forKey:@"lng"];
    [dic setObject:nature forKey:@"nature"];
    [dic setObject:education forKey:@"education"];
    [dic setObject:[NSString stringWithFormat:@"%ld", (long)currentPage] forKey:@"page"];
    [dic setObject:PageSize forKey:@"number"];
    [dic setObject:job_id forKey:@"job_id"];
    
    [BaseNetManager requestWithMethod:POST path:ResumeGetLists_URL params:dic successBlock:^(NSDictionary *responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            if ((self->currentPage == 1) && (self->itemDataArray.count)) {
                [self->itemDataArray removeAllObjects];
            }
            id data = responseObject[@"data"];
            if ([data isKindOfClass:[NSArray class]]) {
                for (NSDictionary *dic in data) {
                    WorkerModel *model = [[WorkerModel alloc] init];
                    [model setValuesForKeysWithDictionary:dic];
                    model.type = WorkerCellTypeOfOnlyTime;
                    model.auth_info = dic[@"auth_info"];
                    [self->itemDataArray addObject:model];
                }
                self.noDataView.hidden = YES;
                [self.jobCompanyTableView.mj_footer endRefreshing];
                [self.jobCompanyTableView reloadData];
            }
            if (self->itemDataArray.count) {
            } else {
                self.noDataView.hidden = NO;
                [self.noDataView vcNilStatusType:VCNilStatusTypeOfWorkerList superView:self.view];
            }
            SVPHUDDismiss;
        } else {
            NSString *str = [NSString stringWithFormat:@"%@", responseObject[@"msg"]];
            SVPHUDError(str);
        }
    } failurBlock:^(NSError *error) {
        SVPHUDError(NetErrorAlertText);
        [self.noDataView vcNilStatusType:VCNilStatusTypeOfNoNet superView:self.view];
    }];
}
- (void)selectJobBtnTap {
    SelectJobViewController *SJVC = [[SelectJobViewController alloc] init];
    __weak __typeof(self)weakSelf = self;
    SJVC.select = ^(NSString *jobId, NSString *jobTitle) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        if (jobId && jobId.length) {
            self->job_id = jobId;
            self->job_title = jobTitle;
            self->jobLbl.text = jobTitle;
            self->currentPage = 1;
            [self->itemDataArray removeAllObjects];
            [strongSelf getCompanyList];
        }
    };
    SJVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:SJVC animated:YES];
}
- (void)initUI {
    CGRect frame = self.noDataView.frame;
    frame.origin.y += 100*Scale;
    self.noDataView.frame = frame;
    
    UIView *bgView = [UIToolsControl initViewWithFrame:CGRectMake(0, HeightOfStatusBar+7, WIDTH-100*Scale, 30) backgroundColor:THEMECOLOR_OF_GRAY];
    bgView.layer.cornerRadius = 15;
    bgView.layer.masksToBounds = YES;
    UIImageView *imgView = [UIToolsControl initImageViewWithFrame:CGRectMake(10, 7, 16, 16) imageName:@"search_icon_gary"];
    [bgView addSubview:imgView];
    searchTextField = [UIToolsControl initTextFieldWithFrame:CGRectMake(EndX(imgView)+10, 0, ViewWidth(bgView)-40, 30) placeholder:SearchWorkerPlaceholderText secureTextEntry:NO font:Font_13 padding:YES];
    searchTextField.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:SearchWorkerPlaceholderText attributes:@{NSForegroundColorAttributeName:THEMECOLOR_OF_TEXT_9a9a9a}];
    searchTextField.returnKeyType = UIReturnKeySearch;
    searchTextField.delegate = self;
    [bgView addSubview:searchTextField];
    self.navigationItem.titleView = bgView;
    
    __weak typeof(self) weakSelf = self;
    self.topBar = [[CQTopBarViewController alloc] init];
    self.topBar.segmentFrame = CGRectMake(0, 44*Scale, WIDTH, 44*Scale);
    self.topBar.sectionTitles = @[@"推荐",@"区域",@"经验",@"其他"];
    self.topBar.delegate = self;
    //推荐
    LYRecomedController *recommendVC = [[LYRecomedController alloc] init];
    recommendVC.itemDataArray = recomendDataArray;
    recommendVC.backBlock = ^(PublicCategoryElementModel *model) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf recomdendItemTap:model];
    };
    
    //区域
//    LYAreaController *areaVC = [[LYAreaController alloc] init];
//    areaVC.itemDataArray = areaDataArray;
//    areaVC.backBlcok = ^(PublicCategoryElementModel *model1, PublicCategoryElementModel *model2) {
//        __strong __typeof(weakSelf)strongSelf = weakSelf;
//        [strongSelf areaItemTap:model1 areaDic:model2];
//    };
    PSAreaController *areaVC = [[PSAreaController alloc] init];
    areaVC.backBlcok = ^(NSDictionary * _Nullable dic) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf areaItemTap:dic];
    };
    
    //公司
    LYCompanyController *companyVC = [[LYCompanyController alloc] init];
    companyVC.itemDataArray = companyDataArray;
    companyVC.backBlock = ^(NSArray<PublicCategoryElementModel *> *array) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf companyItemTap:array];
    };
    
    //要求
    LYClaimController *claimVC = [[LYClaimController alloc] init];
    claimVC.itemDataArray = claimDataArray;
    claimVC.backBlock = ^(NSArray<PublicCategoryElementModel *> *array) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf claimItemTap:array];
    };
    
    self.topBar.pageViewClasses = @[recommendVC, areaVC, companyVC, claimVC];
    self.topBar.selectSegmentImage = @"pulldown_select";
    self.topBar.segmentImage = @"pulldown_unselect";
    self.topBar.selectedTitleTextColor = THEMECOLOR_OF_ORANGE;
    self.topBar.titleTextColor = THEMECOLOR_OF_TEXT_666666;
    [self addChildViewController:self.topBar];
    [self.view addSubview:self.topBar.view];
    
    self.jobCompanyTableView = [UIToolsControl initTableViewWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-HeightOfTabBar-HeightOfStatusBarAndNavigationBar) target:self style:UITableViewStyleGrouped];
    self.jobCompanyTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    self.jobCompanyTableView.mj_footer = [MJRefreshAutoFooter footerWithRefreshingBlock:^{
        self->currentPage++;
        [weakSelf.jobCompanyTableView.mj_footer beginRefreshing];
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [weakSelf getCompanyList];
        });
    }];
    
    [self.topBar.footerView addSubview:self.jobCompanyTableView];
    
    UIView *bottomView = [UIToolsControl initViewWithFrame:CGRectMake(0, 0, WIDTH, 44*Scale) backgroundColor:COLOR_OF_WHITE];
    [self.view addSubview:bottomView];
    [bottomView borderColor:THEMECOLOR_OF_TEXT_cccccc borderWidth:lineH borderType:BorderSideTypeBottom];
    jobLbl = [UIToolsControl initLabelWithFrame:CGRectMake(LeftSpace, 0, 300*Scale, 44*Scale) text:nil textColor:THEMECOLOR_OF_TEXT_333333 font:Font_17];
    [bottomView addSubview:jobLbl];
    UILabel *rightLbl = [UIToolsControl initLabelWithFrame:CGRectMake(0, 0, WIDTH-30*Scale, 44*Scale) text:@"其他职位 " textColor:THEMECOLOR_OF_TEXT_666666 font:Font_15];
    rightLbl.textAlignment = NSTextAlignmentRight;
    rightLbl.backgroundColor = COLOR_OF_CLEAR;
    [bottomView addSubview:rightLbl];
    UIImageView *rightImgView = [UIToolsControl initImageViewWithFrame:CGRectMake(EndX(rightLbl)+5*Scale, 15*Scale, 7*Scale, 13*Scale) imageName:@"jiantou_right"];
    rightImgView.userInteractionEnabled = NO;
    [bottomView addSubview:rightImgView];
    UIButton *selectJobBtn = [UIToolsControl initButtonWithFrame:CGRectMake(0, 0, WIDTH, 44*Scale) imageName:nil target:self action:@selector(selectJobBtnTap) title:nil titleColor:nil];
    [self.view addSubview:selectJobBtn];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (itemDataArray.count) {
        return itemDataArray.count;
    }
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    WorkerCell *cell = [tableView dequeueReusableCellWithIdentifier:isCellID];
    if (!cell) {
        cell = [[WorkerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:isCellID];
    }
    
    WorkerModel *model = itemDataArray[indexPath.row];
    [cell reloadDataModel:model];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    WorkerModel *model = itemDataArray[indexPath.row];
    WorkerResumeDetailViewController *WRDVC = [[WorkerResumeDetailViewController alloc] init];
    WRDVC.job_id = job_id;
    WRDVC.job_cn = job_title;
    WRDVC.id = model.id;
    WRDVC.showChatSettingFlag = NO;
    WRDVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:WRDVC animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    WorkerModel *model = itemDataArray[indexPath.row];
    NSInteger avatar = [model.auth_info[@"avatar"] integerValue];
    NSInteger realname = [model.auth_info[@"realname"] integerValue];
    NSInteger education = [model.auth_info[@"education"] integerValue];
    NSInteger work = [model.auth_info[@"work"] integerValue];
    if (avatar == 1 || realname == 1 || education == 1 || work == 1) {
        return (144-36)*Scale + 25*Scale;
    }
    return (144-36)*Scale;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.00001;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.00001;
}
- (void)dropDownViewTapBack {
    self.noDataView.hidden = YES;
}
#pragma mark -- Action
- (void)recomdendItemTap:(PublicCategoryElementModel *)model {
    [self hiddenNoDataView];
    [self.topBar topBarReplaceObjectsAtIndexes:0 withObjects:@"推荐"];
    NSLog(@"--%@", model.name);
    if (recommend && (![recommend isEqualToString:model.id])) {
        [itemDataArray removeAllObjects];
    }
    recommend = model.id;
    currentPage = 1;
    [self getCompanyList];
}
//- (void)areaItemTap:(PublicCategoryElementModel *)model1 areaDic:(PublicCategoryElementModel *)model2 {
//    [self.topBar topBarReplaceObjectsAtIndexes:1 withObjects:@" 区域"];
//    NSLog(@"%@", [NSString stringWithFormat:@"%@-%@", model1.name, model2.name]);
//}
- (void)areaItemTap:(NSDictionary *)dic {
    [self hiddenNoDataView];
    [self.topBar topBarReplaceObjectsAtIndexes:1 withObjects:@" 区域"];
    if (dic && dic.allKeys.count) {
        NSString *str = [NSString stringWithFormat:@"%@%@-%@%@-%@%@", dic[@"province"], dic[@"provinceid"], dic[@"city"], dic[@"cityid"], dic[@"area"], dic[@"areaid"]];
        NSLog(@"%@", str);
        if (district && (![district isEqualToString:[NSString stringWithFormat:@"%@", dic[@"cityid"]]])) {
            [itemDataArray removeAllObjects];
        }
//        district = [NSString stringWithFormat:@"%@", dic[@"cityid"]];
        if ([[NSString stringWithFormat:@"%@", dic[@"cityid"]] integerValue] == 0) {
            district = [NSString stringWithFormat:@"%@", dic[@"provinceid"]];
        } else {
            if ([[NSString stringWithFormat:@"%@", dic[@"areaid"]] integerValue] == 0) {
                district = [NSString stringWithFormat:@"%@", dic[@"cityid"]];
            } else {
                district = [NSString stringWithFormat:@"%@", dic[@"areaid"]];
            }
        }
        currentPage = 1;
        [self getCompanyList];
    }
}
- (void)companyItemTap:(NSArray<PublicCategoryElementModel *> *)array {
    [self hiddenNoDataView];
    [self.topBar topBarReplaceObjectsAtIndexes:2 withObjects:@"公司"];
    if (array.count) {
        NSString *str = @"";
        for (PublicCategoryElementModel *model in array) {
            str = [NSString stringWithFormat:@"%@-%@", str, model.name];
            if ([model.titleName isEqualToString:@"经验"]) {
                if (experience && (![experience isEqualToString:model.id])) {
                    [itemDataArray removeAllObjects];
                }
                experience = model.id;
            }
        }
        if (itemDataArray.count) {
            
        } else {
            currentPage = 1;
            [self getCompanyList];
        }
        NSLog(@"%@", str);
    } else {
        if (experience.length) {
            experience = @"";
            currentPage = 1;
            [self getCompanyList];
        }
    }
}
- (void)claimItemTap:(NSArray<PublicCategoryElementModel *> *)array {
    [self hiddenNoDataView];
    [self.topBar topBarReplaceObjectsAtIndexes:3 withObjects:@"要求"];
    if (array.count) {
        NSString *str = @"";
        for (PublicCategoryElementModel *model in array) {
            str = [NSString stringWithFormat:@"%@-%@", str, model.name];
            if ([model.titleName isEqualToString:@"薪资"]) {
                if (wage && (![wage isEqualToString:model.id])) {
                    [itemDataArray removeAllObjects];
                }
                wage = model.id;
//                maxwage = model.id;
//                [self getCompanyList];
            } else if ([model.titleName isEqualToString:@"学历"]) {
                if (education && (![education isEqualToString:model.id])) {
                    [itemDataArray removeAllObjects];
                }
                education = model.id;
            } else if ([model.titleName isEqualToString:@"求职状态"]) {
                if (nature && (![nature isEqualToString:model.id])) {
                    [itemDataArray removeAllObjects];
                }
                nature = model.id;
            }
        }
        if (itemDataArray.count) {
            
        } else {
            currentPage = 1;
            [self getCompanyList];
        }
        NSLog(@"%@", str);
    } else {
        if (education.length || wage.length || nature.length) {
            education = @"";
            wage = @"";
            nature = @"";
            currentPage = 1;
            [self getCompanyList];
        }
    }
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    if (keyword && (![keyword isEqualToString:textField.text])) {
        [itemDataArray removeAllObjects];
    }
    keyword = textField.text;
    currentPage = 1;
    [self getCompanyList];
    return YES;
}
- (void)hiddenNoDataView {
    if (itemDataArray.count) {
        self.noDataView.hidden = YES;
    } else {
        self.noDataView.hidden = NO;
    }
}
- (void)loadDataForJobList {
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:@"1" forKey:@"status"];
    [dic setObject:@"1" forKey:@"page"];
    [dic setObject:@"1" forKey:@"number"];
    
    [BaseNetManager requestWithMethod:POST path:Company_GetJob_Lists_URL params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            id data = responseObject[@"data"];
            if ([data isKindOfClass:[NSArray class]]) {
                if ([data count]) {
                    NSDictionary *dicc = data[0];
                    CompanyJobModel *model = [[CompanyJobModel alloc] init];
                    [model setValuesForKeysWithDictionary:dicc];
                    self->job_id = model.id;
                    self->job_title = model.title;
                    self->jobLbl.text = self->job_title;
                    [self getCompanyList];
                }
            }
        }
    } failurBlock:^(NSError * _Nonnull error) {
        
    }];
}
- (void)loadLocalData {
    recomendDataArray = [NSMutableArray arrayWithCapacity:0];
    areaDataArray = [NSMutableArray arrayWithCapacity:0];
    companyDataArray = [NSMutableArray arrayWithCapacity:0];
    claimDataArray = [NSMutableArray arrayWithCapacity:0];
    
    NSArray *recomendArr = @[@{@"name":@"推荐",
                               @"id":@"1"},
                             @{@"name":@"最新",
                               @"id":@"0"}];
    for (NSInteger i = 0; i < recomendArr.count; i++) {
        PublicCategoryElementModel *model = [[PublicCategoryElementModel alloc] init];
        [model setValuesForKeysWithDictionary:recomendArr[i]];
        [recomendDataArray addObject:model];
    }
    
    NSArray *areaArr = @[@{@"name":@"附近",
                           @"id":@"0",
                           @"child":@[@{@"name":@"距离不限",
                                        @"id":@"0"},
                                      @{@"name":@"1公里",
                                        @"id":@"0"},
                                      @{@"name":@"3公里",
                                        @"id":@"0"}]},
                         @{@"name":@"商圈",
                           @"id":@"0",
                           @"child":@[@{@"name":@"海淀区",
                                        @"id":@"0"},
                                      @{@"name":@"朝阳区",
                                        @"id":@"0"},
                                      @{@"name":@"通州区",
                                        @"id":@"0"}]}];
    for (NSInteger i = 0; i < areaArr.count; i++) {
        PublicCategoryElementModel *model = [[PublicCategoryElementModel alloc] init];
        [model setValuesForKeysWithDictionary:areaArr[i]];
        [areaDataArray addObject:model];
    }
    
    if ([DataToolsControl sharedManager].allCategoryInfoModel) {
        PublicCategoryElementModel *companyModel1 = [[PublicCategoryElementModel alloc] init];
        companyModel1.name = @"工作经验";
        companyModel1.id = @"1";
        companyModel1.childArray = [NSMutableArray arrayWithCapacity:0];
        PublicCategoryElementModel *mmodel111 = [[PublicCategoryElementModel alloc] init];
        mmodel111.id = @"0";
        mmodel111.name = @"不限";
        mmodel111.titleName = @"工作经验";
        [companyModel1.childArray addObject:mmodel111];
        for (NSInteger i = 0; i < [DataToolsControl sharedManager].allCategoryInfoModel.experienceArray.count; i++) {
            PublicCategoryElementModel *mmodel1 = [[DataToolsControl sharedManager].allCategoryInfoModel.experienceArray[i] copy];
            mmodel1.titleName = @"工作经验";
            [companyModel1.childArray addObject:mmodel1];
        }
        [companyDataArray addObject:companyModel1];
        
        
        PublicCategoryElementModel *claimModel1 = [[PublicCategoryElementModel alloc] init];
        claimModel1.name = @"薪资";
        claimModel1.id = @"4";
        claimModel1.childArray = [NSMutableArray arrayWithCapacity:0];
        PublicCategoryElementModel *mmodel222 = [[PublicCategoryElementModel alloc] init];
        mmodel222.id = @"0";
        mmodel222.name = @"不限";
        mmodel222.titleName = @"薪资";
        [claimModel1.childArray addObject:mmodel222];
        for (NSInteger i = 0; i < [DataToolsControl sharedManager].allCategoryInfoModel.wageArray.count; i++) {
            PublicCategoryElementModel *mmodel2 = [[DataToolsControl sharedManager].allCategoryInfoModel.wageArray[i] copy];
            mmodel2.titleName = @"薪资";
            [claimModel1.childArray addObject:mmodel2];
        }
        [claimDataArray addObject:claimModel1];
        
        PublicCategoryElementModel *education1 = [[PublicCategoryElementModel alloc] init];
        education1.name = @"学历";
        education1.id = @"5";
        education1.childArray = [NSMutableArray arrayWithCapacity:0];
        PublicCategoryElementModel *mmodel333 = [[PublicCategoryElementModel alloc] init];
        mmodel333.id = @"0";
        mmodel333.name = @"不限";
        mmodel333.titleName = @"学历";
        [education1.childArray addObject:mmodel333];
        for (NSInteger i = 0; i < [DataToolsControl sharedManager].allCategoryInfoModel.educationArray.count; i++) {
            PublicCategoryElementModel *mmodel3 = [[DataToolsControl sharedManager].allCategoryInfoModel.educationArray[i] copy];
            mmodel3.titleName = @"学历";
            [education1.childArray addObject:mmodel3];
        }
        [claimDataArray addObject:education1];
        
        PublicCategoryElementModel *current1 = [[PublicCategoryElementModel alloc] init];
        current1.name = @"求职状态";
        current1.id = @"5";
        current1.childArray = [NSMutableArray arrayWithCapacity:0];
        PublicCategoryElementModel *mmodel444 = [[PublicCategoryElementModel alloc] init];
        mmodel444.id = @"0";
        mmodel444.name = @"不限";
        mmodel444.titleName = @"求职状态";
        [current1.childArray addObject:mmodel444];
        for (NSInteger i = 0; i < [DataToolsControl sharedManager].allCategoryInfoModel.currentArray.count; i++) {
            PublicCategoryElementModel *mmodel4 = [[DataToolsControl sharedManager].allCategoryInfoModel.currentArray[i] copy];
            mmodel4.titleName = @"求职状态";
            [current1.childArray addObject:mmodel4];
        }
        [claimDataArray addObject:current1];
    }
}

@end
